package com.hst.capacity.infra.persistence.jpa.marketing.promotion;

import com.hst.capacity.domain.model.entity.marketing.promotion.MemberPromotionEntity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface MemberPromotionRepository extends JpaRepository<MemberPromotionEntity, String> {

    @Query("select t from MemberPromotionEntity t where t.idPromotion = :idPromotion")
    List<MemberPromotionEntity> findByIdPromotion(String idPromotion);

    @Query("select t from MemberPromotionEntity t where t.idMember = :idMember and t.idPromotion=:idPromotion")
    List<MemberPromotionEntity> findByIdMemberAndIdPromotion(String idMember,String idPromotion);

    @Query("select t.idPromotion from MemberPromotionEntity t where t.idMember = :idMember")
    List<String> findPromotionByIdMember(String idMember);

}